package es.controller;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.io.IOException;


/**
 * @author BANGO
 */
@RestController
@RequestMapping("/es")
public class EsController {

//    @Resource
//    private RestHighLevelClient client;
//
//    @PostMapping("/add")
//    public CommonResult<Object> reduce(@RequestBody EsTestDto dto){
//        //1.创建索引
//        CreateIndexRequest request = new CreateIndexRequest("test001");
//        //2、执行创建请求 请求后获得响应
//        try {
//            CreateIndexResponse createIndexResponse = client.indices().create(request, RequestOptions.DEFAULT);
//        } catch (IOException e) {
//            return CommonResult.error("执行错误");
//        }
//        return CommonResult.success("ok");
//    }
}
